package util

import (
	"fmt"
	"github.com/go-resty/resty/v2"
	"github.com/tidwall/gjson"
)

// 消息加签
func GetSign() (timestamp, sign string) {
	client := resty.New()

	resp, _ := client.R().
		SetQueryParams(map[string]string{
			"appId": "18130100010000",
		}).
		Post("http://uc-test.sit01.91lyd.com/test/getSign")

	fmt.Print("resp: ", resp)
	data := resp.Body()
	timestamp = gjson.GetBytes(data, "data.timestamp").String()
	sign = gjson.GetBytes(data, "data.sign").String()

	return timestamp, sign
}